home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / Examples / Table / Include / TblSel.h < prev    next >
Encoding:
Text File  |  1995-11-08  |  3.9 KB  |  122 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                TblSel.h
  4. //    Release Version:    $ 1.0d11 $
  5. //
  6. //    Copyright:    © 1995 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef TBLSEL_H
  11. #define TBLSEL_H
  12.  
  13. #ifndef TBLPART_H
  14. #include "TblPart.h"
  15. #endif
  16.  
  17. // ----- ODF Includes -----
  18.  
  19. #ifndef FWSLCING_H
  20. #include "FWSlcing.h"
  21. #endif
  22.  
  23. //==============================================================================
  24. //    Forward declarations
  25. //==============================================================================
  26.  
  27. class FW_CLASS_ATTR CTablePart;
  28. class FW_CLASS_ATTR CTableProxy;
  29.  
  30. //==============================================================================
  31. //    class CTableSelection
  32. //==============================================================================
  33.  
  34. class FW_CLASS_ATTR CTableSelection : public FW_CEmbeddingSelection
  35. {
  36. //----------------------------------------------------------------------------------------
  37. //    Initialization/Destruction
  38. //
  39.   public:
  40.     CTableSelection(Environment* ev, CTablePart* tablePart);
  41.     virtual ~ CTableSelection();
  42.     
  43. //----------------------------------------------------------------------------------------
  44. //    Inherited API
  45. //
  46.   public:
  47.     virtual FW_Boolean        IsEmpty(Environment* ev) const;    
  48.     virtual FW_MProxy*        IsSelectionOnlyOneProxy(Environment* ev) const;
  49.     virtual void            CloseSelection(Environment* ev);
  50.     virtual FW_Boolean        ClearSelection(Environment* ev);
  51.     virtual void            SelectAll(Environment* ev);
  52.     virtual ODShape*        CreateSelectionFrameShape(Environment* ev);
  53.  
  54.     // ----- Drag and Drop -----
  55.     virtual ODShape*        CreateSelectionShape(Environment* ev, ODFacet* facet, FW_CFrame* frame) const;
  56.     
  57.     virtual FW_Boolean        IsMouseInDraggableItem(Environment* ev, 
  58.                                 FW_CFrame* frame, 
  59.                                 const FW_CMouseEvent& theMouseEvent, 
  60.                                 FW_Boolean inBackground) const;
  61.                                 
  62.     virtual void            UpdateSelectionOnMouseDown(Environment* ev, 
  63.                                 const FW_CMouseEvent& mouseEvent,
  64.                                 ODFacet* embeddedFacet,
  65.                                 FW_Boolean inEmbeddedFrameBorder,
  66.                                 FW_Boolean inBackground);
  67.  
  68.     // ----- Externalize/Internalize Selection -----
  69.     virtual void            DoExternalizeSelection(Environment* ev, 
  70.                                                     ODStorageUnit* destinationSU,
  71.                                                     FW_CCloneInfo* cloneInfo);
  72.     virtual FW_Boolean        DoInternalizeSelection(Environment* ev, 
  73.                                                     ODStorageUnit* sourceSU,
  74.                                                     FW_CCloneInfo* cloneInfo);
  75.  
  76.     // ----- Linking Support -----
  77.     virtual FW_Boolean        CanSubscribe(Environment* ev, ODPasteAsMergeSetting& setting);
  78.  
  79.     virtual FW_Boolean        IsSelectionPublishable(Environment* ev);
  80.                                 // Don't allow publishing if cell is a link destination
  81.  
  82.     virtual FW_CPublishLink* DoFindPublisher(Environment* ev);
  83.  
  84. //----------------------------------------------------------------------------------------
  85. //    New API
  86. //
  87.   public:
  88.     // ----- Getters/Setters -----
  89.     CCell                GetCell() const;
  90.  
  91.     // ----- Selection -----
  92.     void                Select(Environment* ev, const CCell& cell, FW_Boolean drawNow);
  93.     void                InvalidateSelectBorder(Environment* ev, const CCell& cell);
  94.  
  95.     void                InvalidateSelection(Environment* ev);
  96.  
  97.     void                SelectProxy(Environment* ev, CTableProxy* proxy);
  98.  
  99. //----------------------------------------------------------------------------------------
  100. //    Data Members
  101. //
  102.   protected:
  103.     // ----- Currently selected cell -----
  104.     CCell                fCell;
  105.     CTablePart*            fTablePart;
  106. };
  107.  
  108.  
  109. //========================================================================================
  110. //    CTableSelection Inlines
  111. //========================================================================================
  112.  
  113. //----------------------------------------------------------------------------------------
  114. //    CTableSelection::GetCell
  115. //----------------------------------------------------------------------------------------
  116. inline CCell CTableSelection::GetCell() const
  117. {
  118.     return fCell;
  119. }
  120.  
  121. #endif
  122.